import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;

public class PrintWriter_Test {
    public static void main(String[] args) throws IOException {
        FileOutputStream fileOutputStream = new FileOutputStream("D:\\Test\\outputStream.txt");
        PrintWriter printWriter = new PrintWriter(fileOutputStream);
        printWriter.println("你好");
        printWriter.printf("%s:%d","单价",5);
        printWriter.flush();
        printWriter.close();
        fileOutputStream.close();
    }
}
